package com.cg.controller;

import com.cg.feign.Service02Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/service01")
public class Service01Controller {

    @Autowired
    private Service02Service service02Service;

    @GetMapping("/getInfo/{userId}")
    public String getInfo(@PathVariable("userId") Integer userId) {
        String info = service02Service.getInfo(userId);
        return "service01调用service02,获取结果为:{" + info + "}";
    }

}
